<template>
  <custom-layout :isTabBar="false" navTitle="用户详情">
    <view class="details">
      <uni-list class="user-info">
        <uni-list-item
          v-for="item in items"
          :key="item.key"
          v-show="data[item.key]"
          :title="item.label"
          :rightText="`${data[item.key]}`"
        />
      </uni-list>
    </view>
  </custom-layout>
</template>

<script>
import { getMenuDetail } from "@/api/system/menu";
export default {
  data() {
    return {
      items: [
        { key: "menuId", label: "ID", icon: "" },
        { key: "menuName", label: "菜单名称", icon: "" },
        { key: "typeName", label: "类型名称", icon: "" },
        { key: "menuCode", label: "权限标识", icon: "" },
        { key: "menuPath", label: "路由地址", icon: "" },
        { key: "redirect", label: "重定向地址", icon: "" },
        { key: "component", label: "组件路径", icon: "" },
        { key: "query", label: "路由参数", icon: "" },
        { key: "orderNum", label: "显示顺序", icon: "" },
        { key: "tabCloseName", label: "离开关闭标签页", icon: "" },
        { key: "frameName", label: "外部链接", icon: "" },
        { key: "cacheName", label: "自动缓存", icon: "" },
        { key: "visibleName", label: "显示状态", icon: "" },
        { key: "statusName", label: "菜单状态", icon: "" },
        { key: "createTime", label: "创建时间", icon: "" },
        { key: "updateTime", label: "更新时间", icon: "" },
      ],
      data: {},
    };
  },
  onLoad(options) {
    getMenuDetail(options.id).then((res) => (this.data = res));
  },
  mounted() {},
  methods: {},
};
</script>

<style lang="scss" scoped>
.details {
  width: 100%;
}
</style>
